<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="huoyun" uri="/huoyun"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>评价中心</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/theme/css/main.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/theme/css/stars.css">

<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/theme/js/stars.js"></script>
<script language="javascript">
	function countChar(content, textCounter) {
		document.getElementById(textCounter).innerHTML = 50 - document
				.getElementById(content).value.length;
	}
</script>

<style type="text/css">
.listTable {
	border: 1px solid #E8E8E8;
	width: 100%;
}

.listTable th {
	background-color: #F6F6F6;
	border-bottom: 1px solid #F1F1F1;
	line-height: 30px;
	padding-left: 10px;
	text-align: left;
}

.listTable td {
	border-bottom: 1px solid #F1F1F1;
	color: #595959;
	line-height: 28px;
	padding: 3px 10px;
	text-align: left;
}
</style>

<style type="text/css">
<!--
body {
	background: #fff;
	text-align: center;
	margin: 0 auto;
	padding: 0;
	font: 12px Arial;
	color: #000;
	line-height: 1.2em
}

div,form,img,ul,ol,li,dl,dt,dd {
	margin: 0;
	padding: 0;
	border: 0;
}

h1,h2,h3,h4,h5,h6 {
	margin: 0;
	padding: 0;
}

table,td,tr,th {
	font-size: 12px;
}
</style>

<style type="text/css">
#submit_button {
	width: 100px;
	height: 40px;
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_normal.png");
	background-size: 100% 100%;
	border: none;
	cursor: pointer;
	font-family: 宋体;
	font-size: 18px;
	font-style: normal;
	color: #fff;
	font-weight: bold;
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_normal_ie.png")
		\9;
}

#submit_button:hover,#submit_button.hover {
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_hover.png");
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_hover_ie.png")
		\9;
}

#submit_button:active,#submit_button.active {
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_down.png");
	background-image:
		url("${pageContext.request.contextPath}/theme/images/button_down_ie.png")
		\9;
}

.red {
	color: red;
}
</style>

</head>
<body>


	<div>
		<jsp:include page="../nav.jsp">
			<jsp:param value="nav_main" name="nav" />
		</jsp:include>
	</div>
	<div class="realCer">

		<!--主体部分-->
		<div class="realMain clearfix mt10">
			<!--左侧菜单-->
			<div class="realLeft" id="meunLeft">
				<jsp:include page="../leftMenu.jsp">
					<jsp:param value="con_nav_main" name="con_nav" />
				</jsp:include>
			</div>
			<!--中由-->
			<div class="realRight ml10">
				<div class="box">
					<div class="tit">运输评价</div>
					<div class="con">
						<!-- 相关的订单信息 -->
						<table class="listTable">
							<tr>
								<th>下单时间</th>
								<th>订单号</th>
								<th>费用/保证金</th>
								<th>车牌号</th>
								<th>货物</th>
								<th>状态</th>
							</tr>
							<tr>
								<td><huoyun:dateFormat date="${orderObj.addTime}"
										dateFormat="yyyy-MM-dd HH:mm:ss" /></td>
								<td><s:property value="orderObj.orderId" /></td>
								<td><s:property value="orderObj.price" /></td>
								<td><s:property value="orderObj.carNumber" /></td>
								<td><s:property value="orderObj.cargisTitle" /></td>
								<s:if test="orderObj.status == 3">
									<td>等待评价</td>
								</s:if>

								<s:else>
									<td>异常终止</td>
								</s:else>
							</tr>
						</table>
						
						<!-- 评价填写处 -->
						<form method="post" name="rateInfo"
							action="${pageContext.request.contextPath}/rate/saveRate.action">
							<input type="hidden" name="rate.orderId" value="${orderObj.id}" />
							<div class="comment" style="margin-top: 20px">
								<div class="textinput"
									style="border: solid 1px grey; width: 320; height: 110">
									<span class="ph-label"></span>
									<s:textarea name="rate.content" maxlength="50"
										class="rate-msg"
										style="width:300;height:90; border:0px; resize:none"
										onkeydown='countChar("rate.content","textCounter");'
										onkeyup='countChar("rate.content","textCounter");'>
									</s:textarea>
									<p class="text-counter">
										还可以输入<span id=" ">50</span>字
									</p>
								</div>
							</div>


							<br> <br> <br>

							<sec:authorize access="hasRole('ROLE_DRIVER')">
								<!-- 对货主的好中差总体评价，无星级评分 -->
								<s:radio list="#{'2':'好评','1':'中评','-1':'差评'}" name="rate.rateTotal" value="2"/>
							</sec:authorize>
							<sec:authorize access="hasRole('ROLE_USER')">
								<!-- 对车主的星级评分 -->
								<table>
									<s:iterator value="itemListForCar" id="itemName" status="st">
										<tr>
											<td width="100px"><span class="title"><s:property
														value="itemName" /> </span></td>
											<td width="200px">
												<ul class="rating-level" id="stars${st.index}"
													style="position: relative; left: 30px;">
													<li><a class="one-star" star:value="1" href="#">1</a></li>
													<li><a class="two-stars" star:value="2" href="#">2</a></li>
													<li><a class="three-stars" star:value="3" href="#">3</a>
													</li>
													<li><a class="four-stars" star:value="4" href="#">4</a>
													</li>
													<li><a class="five-stars" star:value="5" href="#">5</a>
													</li>
												</ul>
											</td>
											<td><span class="result" id="stars${st.index}-tips"></span></td>
											<input type="hidden" id="stars${st.index}-input"
												name="rateList[${st.index}]" value="0" size="2" />
										</tr>
									</s:iterator>
								</table>
								<s:radio list="#{'2':'好评','1':'中评','-1':'差评'}" name="rate.rateTotal" value="2"/>
							</sec:authorize>
					</div>
					<input type="submit" name="submit_button" id="submit_button"
						value="提交评价" class="submit_button" style="margin-top: 30px" />
					</form>
				</div>
			</div>
		</div>
		<!--中右-->

	</div>
	<div>
		<jsp:include page="/footer.jsp"></jsp:include>
	</div>

	<script type="text/javascript">
		var Stars1 = new Stars("stars0");
		var Stars1 = new Stars("stars1");
		var Stars2 = new Stars("stars2");
		var Stars3 = new Stars("stars3");
		var Stars4 = new Stars("stars4");
	</script>


</body>
</html>